<!DOCTYPE html>
<html>
  <head>
    <meta charset="utf-8" />
    <title>Web Components</title>
  </head>
  <body>
    <goods-card
      img="https://img1.baidu.com/it/u=2613325730,275475287&fm=224&fmt=auto&gp=0.jpg"
      name="跑鞋"></goods-card>
    <!-- 以下是组件 -->
    <script src="./components/GoodsCard.js"></script>
    <script>
      document.querySelector('goods-card').addEventListener('onButton', (e) => {
        alert('跑鞋', e.detail)
      })
    </script>
  </body>
</html>
